<?php
namespace App\Controller;

use Think\Controller;

class BaseController extends Controller
{
    protected function _initialize()
    {
        $cou_time = time();
        $cou_ip = $_SERVER["REMOTE_ADDR"];
        $cou_url = $_SERVER['PHP_SELF'] ;
        $this->assign(array(
            'cou_time' => $cou_time,
            'cou_ip' => $cou_ip,
            'cou_url' => $cou_url
        ));
    }

    // 设置页面信息
    public function setPageInfo($title, $keywords, $description, $showNav=0, $css=array(), $js=array())
    {
        $this->assign('page_keywords', $keywords);          //页面关键词
        $this->assign('page_description', $description);    //页面描述
        $this->assign('page_title', $title);                //页面标题
        $this->assign('show_nav', $showNav);
        $this->assign('page_css', $css);
        $this->assign('page_js', $js);
    }

}
/**
 * Created by PhpStorm.
 * User: lenovo
 * Date: 2017/4/11
 * Time: 10:34
 */